package com.ruoyi.erecord.locus.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.Translation;
import com.ruoyi.common.constant.TransConstant;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;


/**
 * 轨迹视图对象 t_locus_new
 *
 * @author cc
 * @date 2023-05-01
 */
@Data
@ExcelIgnoreUnannotated
public class LocusVo {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @ExcelProperty(value = "")
    private String id;

    /**
     * 设备类型
     */
    @ExcelProperty(value = "设备类型")
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, other = "device_type")
    private String deviceType;

    /**
     * 姓名|车牌号
     */
    @ExcelProperty(value = "姓名|车牌号")
    private String deviceName;

    /**
     * 编码
     */
    @ExcelProperty(value = "编码")
    private String deviceCode;

    /**
     * 设备原始ID(车辆表ID|人员表ID)
     */
    @ExcelProperty(value = "设备原始ID(车辆表ID|人员表ID)")
    private String deviceOriginalId;

    /**
     * SIM卡号
     */
    @ExcelProperty(value = "SIM卡号")
    private String simCode;

    /**
     * 速度(公里/小时)
     */
    @ExcelProperty(value = "速度(公里/小时)")
    private Long speed;

    /**
     * 经度
     */
    @ExcelProperty(value = "经度")
    private BigDecimal pointx;

    /**
     * 维度
     */
    @ExcelProperty(value = "维度")
    private BigDecimal pointy;

    /**
     * 定位时间
     */
    @ExcelProperty(value = "定位时间")
    private Date gpsTime;

    /**
     * GSM信号等级
     */
    @ExcelProperty(value = "GSM信号等级")
    private Long gsmLevel;

    /**
     * GPS状态
     */
    @ExcelProperty(value = "GPS状态")
    private String gpsState;

    /**
     * 充电状态
     */
    @ExcelProperty(value = "充电状态")
    private String powerState;

    /**
     * 电量
     */
    @ExcelProperty(value = "电量")
    private Long powerLevel;

    /**
     * 告警扩展
     */
    @ExcelProperty(value = "告警扩展")
    private String alertState;

    /**
     * 报警状态
     */
    @ExcelProperty(value = "报警状态")
    private String alarmState;

    /**
     * 运动状态
     */
    @ExcelProperty(value = "运动状态")
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, other = "locus_yes_no")
    private String sportState;

    /**
     * UP模式
     */
    @ExcelProperty(value = "UP模式")
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, other = "locus_up_model")
    private String upModel;

    /**
     * UP状态
     */
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, other = "locus_up_state")
    @ExcelProperty(value = "UP状态")
    private String upState;

    /**
     * 定位日期
     */
    @ExcelProperty(value = "定位日期")
    private Date queryDate;

    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, other = "locus_yes_no")
    private String inRegion;
    /**
     * acc状态 accstate
     */
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, other = "acc_state")
    private String accState;


    public String getGpsValue() {
        if (this.pointx != null && this.pointy != null) {
            return this.pointx.toString() + "," + this.pointy.toString();
        } else {
            return "0,0";
        }
    }
}
